import request from '@/utils/request'

export function listOrg(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/list',
    method: 'post',
    data
  })
}

export function listTreeOrg(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/list-tree',
    method: 'post',
    data
  })
}

export function getOrg(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/get',
    method: 'post',
    data
  })
}

export function postOrg(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/post',
    method: 'post',
    data
  })
}

export function patchOrg(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/patch',
    method: 'post',
    data
  })
}

export function deleteOrg(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/delete',
    method: 'post',
    data
  })
}

export function listGrade(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/grade/list',
    method: 'post',
    data
  })
}

export function getGrade(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/grade/get',
    method: 'post',
    data
  })
}

export function postGrade(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/grade/post',
    method: 'post',
    data
  })
}

export function patchGrade(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/grade/patch',
    method: 'post',
    data
  })
}

export function deleteGrade(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/org/grade/delete',
    method: 'post',
    data: {
      id: data
    }
  })
}
